<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
    <title>Home</title>
    <link rel="stylesheet" th:href="@{/frame/vendors/mdi/css/materialdesignicons.min.css}">
    <link rel="stylesheet" th:href="@{/frame/vendors/base/vendor.bundle.base.css}">
    <link rel="stylesheet" th:href="@{/frame/vendors/datatables.net-bs4/dataTables.bootstrap4.css}">
    <link rel="stylesheet" th:href="@{/css/style.css}">
</head>
<body>
<div class="container-scroller">
    <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
        <div class="navbar-brand-wrapper d-flex justify-content-center">
            <div class="navbar-brand-inner-wrapper d-flex justify-content-between align-items-center w-100">
                <a class="navbar-brand brand-logo" th:href="@{/index}">
                    <h1>
                        <span class="display-4" th:text="${session.user.getUserName()}+'欢迎!'"></span>
                    </h1>
                </a>
                <button class="navbar-toggler navbar-toggler align-self-center" data-toggle="minimize" type="button">
                    <span class="mdi mdi-sort-variant"></span>
                </button>
            </div>
        </div>
        <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
            <ul class="navbar-nav navbar-nav-right">
                <li class="nav-item nav-profile dropdown">
                    <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="profileDropdown">
                        <img alt="profile" th:src="@{/img/head.jpg}">
                        <span class="nav-profile-name" th:text="${session.user.getUserName()}"></span>
                    </a>
                    <div aria-labelledby="profileDropdown" class="dropdown-menu dropdown-menu-right navbar-dropdown">
                        <a class="dropdown-item" th:href="@{/user/setting}">
                            <i class="mdi mdi-settings text-primary"></i>
                            设置
                        </a>
                        <a class="dropdown-item" th:href="@{/loginout}">
                            <i class="mdi mdi-logout text-primary"></i>
                            登出
                        </a>
                    </div>
                </li>
            </ul>
            <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" data-toggle="offcanvas"
                    type="button">
                <span class="mdi mdi-menu"></span>
            </button>
        </div>
    </nav>
    <div class="container-fluid page-body-wrapper">
        <nav class="sidebar sidebar-offcanvas" id="sidebar">
            <ul class="nav">
                <li class="nav-item">
                    <a class="nav-link" th:href="@{/index}">
                        <i class="mdi mdi-home menu-icon"></i>
                        <span class="menu-title">主页</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" th:href="@{/user/bindcenter}">
                        <i class="mdi mdi-view-headline menu-icon"></i>
                        <span class="menu-title">设备绑定中心</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" th:href="@{/user/cars}">
                        <i class="mdi mdi-grid-large menu-icon"></i>
                        <span class="menu-title">设备中心</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" th:href="@{/user/setting}">
                        <i class="mdi mdi-account menu-icon"></i>
                        <span class="menu-title">用户中心</span>
                    </a>
                </li>
            </ul>
        </nav>
        <div class="main-panel">
            <div class="content-wrapper">
                <div class="row">
                    <div class="col-md-12 grid-margin">
                        <div class="d-flex justify-content-between flex-wrap">
                            <div class="d-flex align-items-end flex-wrap">
                                <div class="mr-md-3 mr-xl-5">
                                    <h2 th:text="${session.user.getUserName()+'欢迎!'}"></h2>
                                    <p class="mb-md-0">您的设备状态总览</p>
                                </div>
                            </div>
                            <div class="d-flex justify-content-between align-items-end flex-wrap">
                                <button class="btn btn-light bg-white btn-icon mr-3 mt-2 mt-xl-0" type="button">
                                    <a class="mdi mdi-clock-outline text-muted"></a>
                                </button>
                                <a class="btn btn-primary mt-2 mt-xl-0" th:href="@{/user/bindcenter}">添加设备</a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12 grid-margin stretch-card">
                        <div class="card">
                            <div class="card">
                                <div class="card-body dashboard-tabs p-0">
                                    <ul class="nav nav-tabs px-4" role="tablist">
                                        <li class="nav-item">
                                            <a aria-controls="overview" aria-selected="true" class="nav-link active"
                                               data-toggle="tab" href="#overview" id="overview-tab"
                                               role="tab">设备总览</a>
                                        </li>
                                    </ul>
                                    <div class="tab-content py-0 px-0">
                                        <div aria-labelledby="overview-tab" class="tab-pane fade show active"
                                             id="overview"
                                             role="tabpanel">
                                            <div class="d-flex flex-wrap justify-content-xl-between">
                                                <div class="d-none d-xl-flex border-md-right flex-grow-1 align-items-center justify-content-center p-3 item">
                                                    <i class="mdi mdi-calendar-heart icon-lg mr-3 text-primary"></i>
                                                    <div class="d-flex flex-column justify-content-around">
                                                        <small class="mb-1 text-muted">当前时间</small>
                                                        <div class="dropdown">
                                                            <a aria-expanded="false"
                                                               aria-haspopup="true"
                                                               class="btn btn-secondary p-0 bg-transparent border-0 text-dark shadow-none font-weight-medium"
                                                               data-toggle="dropdown"
                                                               href="#" id="dropdownMenuLinkA"
                                                               role="button">
                                                                <h5 class="mb-0 d-inline-block">
                                                                    [[${#dates.format(new
                                                                    java.util.Date().getTime(), 'yyyy-MM-dd
                                                                    hh:mm:ss')}]]</h5>
                                                            </a>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="d-flex py-3 border-md-right flex-grow-1 align-items-center justify-content-center p-3 item">
                                                    <i class="mdi mdi-flag mr-3 icon-lg text-danger"></i>
                                                    <div class="d-flex flex-column justify-content-around">
                                                        <small class="mb-1 text-muted">车辆总数</small>
                                                        <h5 class="mr-2 mb-0" th:text="${carNumbers}"></h5>
                                                    </div>
                                                </div>
                                                <div class="d-flex border-md-right flex-grow-1 align-items-center justify-content-center p-3 item">
                                                    <i class="mdi mdi-eye mr-3 icon-lg text-success"></i>
                                                    <div class="d-flex flex-column justify-content-around">
                                                        <small class="mb-1 text-muted">设备总数</small>
                                                        <h5 class="mr-2 mb-0" th:text="${iotNumbers}"></h5>
                                                    </div>
                                                </div>
                                                <div class="d-flex border-md-right flex-grow-1 align-items-center justify-content-center p-3 item">
                                                    <i class="mdi mdi-download mr-3 icon-lg text-warning"></i>
                                                    <div class="d-flex flex-column justify-content-around">
                                                        <small class="mb-1 text-muted">整体数据量</small>
                                                        <h5 class="mr-2 mb-0" th:text="${iotsDatasNumber}"></h5>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/frame/vendors/base/vendor.bundle.base.js}"></script>
<script th:src="@{/frame/vendors/chart.js/Chart.min.js}"></script>
<script th:src="@{/frame/vendors/datatables.net/jquery.dataTables.js}"></script>
<script th:src="@{/frame/vendors/datatables.net-bs4/dataTables.bootstrap4.js}"></script>
<script th:src="@{/js/off-canvas.js}"></script>
<script th:src="@{/js/hoverable-collapse.js}"></script>
<script th:src="@{/js/template.js}"></script>
<script th:src="@{/js/dashboard.js}"></script>
<script th:src="@{/js/data-table.js}"></script>
<script th:src="@{/js/jquery.dataTables.js}"></script>
<script th:src="@{/js/dataTables.bootstrap4.js}"></script>
</body>

</html>

